'use strict';
let log4js = require('log4js');
var config = require('../config').log4js;
module.exports = function(app) {

  log4js.configure(config);


  const logger = log4js.getLogger('info');
  const errorLogger = log4js.getLogger('error');
  const warnLogger = log4js.getLogger('warn');
  console.log = logger.info.bind(logger);
  console.warn = warnLogger.warn.bind(warnLogger);
  console.error = errorLogger.error.bind(errorLogger);
  app.use(log4js.connectLogger(logger, { level: 'all' }));
};
